<script>
    var global = {
        data() {
            return {

            }
        },
        created(){

        },
        methods: {
            logout() {
                localStorage.removeItem('token');
                this.clearCookie('token')
                api.GET('/user/logout',null,(result)=>{
                    if(result.code===0){
                        this.$message({
                            showClose: true,
                            message: '成功退出登录',
                            type: 'success'
                        });
                        location.href="/login"
                    }
                })
            },
            locationfref(href){
                location.href=href;
            },
            clearCookie(name) {
                document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/";
            }
        }
    }
</script>
